package pl.bank.view.beans;

import javax.faces.event.ActionEvent;

import oracle.adf.share.logging.ADFLogger;
import oracle.adf.view.rich.component.rich.layout.RichPanelGroupLayout;
import oracle.adf.view.rich.component.rich.nav.RichCommandButton;

public class AccountTabBean {
    private ADFLogger LOG = ADFLogger.createADFLogger(this.getClass().getName());
    private static final String SHOW = "Pokaż dane osobowe";
    private static final String HIDE = "Ukryj dane osobowe";

    private RichPanelGroupLayout clientData;

    public AccountTabBean() {
        super();
    }

    public void setClientData(RichPanelGroupLayout clientData) {
        this.clientData = clientData;
    }

    public RichPanelGroupLayout getClientData() {
        return clientData;
    }

    public void showClientData(ActionEvent actionEvent) {
        LOG.entering(this.getClass().getName(), "showClientData", actionEvent);
        RichCommandButton button = (RichCommandButton)actionEvent.getComponent();
        if (clientData.isVisible()) {
            clientData.setVisible(false);
            button.setText(SHOW);
        } else {
            clientData.setVisible(true);
            button.setText(HIDE);
        }
        LOG.exiting(this.getClass().getName(), "showClientData");
    }
}
